require 'rubygems'
require 'savon'

class AuthenticationInfo
  def initialize
    @client = Savon::Client.new do
      wsdl.document = "http://sci-psych.com/mc747/AuthService/public/index/wsdl"
    end
  end
  
  def authenticate(cpf_cnpj, pass)
    r = @client.request :authenticate do
      soap.body = {
        :cpf => cpf_cnpj,
        :password => pass
      }
    end
    h = r.to_hash
    h[:authenticate_response][:return]
  end
end
